
import 'dart:convert';

import 'package:ichinesereader/models/common/ReadRanking.dart';

LeaderBoard leaderBoardFromJson(String str) =>
    LeaderBoard.fromJson(json.decode(str));

String leaderBoardToJson(LeaderBoard data) => json.encode(data.toJson());

class LeaderBoard {
  LeaderBoard({
    this.status,
    this.message,
    this.result,
  });

  int? status;
  String? message;
  Result? result;

  factory LeaderBoard.fromJson(Map<String, dynamic> json) => LeaderBoard(
        status: json["status"],
        message: json["message"],
        result: json["result"]!=null ? Result.fromJson(json["result"]) : null,
      );

  Map<String, dynamic> toJson() => {
        "status": status,
        "message": message,
        "result": result!=null ? result?.toJson() : null,
      };
}

class Result {
  Result({
    this.data,
  });

  List<ReadRanking>? data;

  factory Result.fromJson(Map<String, dynamic> json) => Result(
        data: json["data"]!=null ? List<ReadRanking>.from(json["data"].map((x) => ReadRanking.fromJson(x))) : null,
      );

  Map<String, dynamic> toJson() => {
        "data": data!=null ? List<dynamic>.from(data!.map((x) => x.toJson())): null,
      };
}
